package com.lawyer.repository;


import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.transaction.annotation.Transactional;

import com.lawyer.entity.RiderOrder;


@RepositoryRestResource(exported = false)
public interface RiderOrderRepository extends PagingAndSortingRepository<RiderOrder, Integer> , JpaSpecificationExecutor<RiderOrder> {
	
	@Override
	public List<RiderOrder> findAll();
	
	

	@Transactional
	@Modifying(clearAutomatically = true)
	@Query(value = "update RiderOrder r set r.orderStatus = ?1 where r.id = ?2")
	int changStatus(String orderStatus, Integer id);
	
}
